package com.zy.algorithm;

import android.content.Intent;

import com.zy.activity.BaseMenuActivity;
import com.zy.activity.bean.BaseBean;
import com.zy.algorithm.sort.bubble.BubbleSortColumnChartV1Fragment;
import com.zy.algorithm.sort.bubble.BubbleSortColumnChartV2Fragment;
import com.zy.algorithm.sort.bubble.BubbleSortColumnChartV3Fragment;
import com.zy.algorithm.sort.bubble.BubbleSortColumnChartV4Fragment;
import com.zy.algorithm.sort.insertion.InsertionSortV1Fragment;
import com.zy.algorithm.sort.insertion.InsertionSortV2Fragment;
import com.zy.algorithm.sort.insertion.InsertionSortV3Fragment;
import com.zy.algorithm.sort.quick.QuickSortV1Fragment;
import com.zy.algorithm.sort.quick.QuickSortV2Fragment;
import com.zy.algorithm.sort.quick.QuickSortV3Fragment;
import com.zy.algorithm.sort.shellsort.ShellInsertionSortV1Fragment;
import com.zy.algorithm.sort.select.SelectSortV1Fragment;
import com.zy.algorithm.sort.select.SelectSortV2Fragment;
import com.zy.algorithm.sort.select.SelectSortV3Fragment;
import com.zy.algorithm.sort.shellsort.ShellInsertionSortV2Fragment;
import com.zy.algorithm.sort.shellsort.ShellInsertionSortV3Fragment;

import java.util.List;

public class AlgorithmMenuActivity extends BaseMenuActivity {


    @Override
    protected void init(List<BaseBean> list) {
        list.add(new BaseBean("排序算法"));

        list.add(new BaseBean("快速排序"));
        list.add(new BaseBean("排序-快速排序", QuickSortV1Fragment.class));
        list.add(new BaseBean("排序-快速排序-顺序数组", QuickSortV2Fragment.class));
        list.add(new BaseBean("排序-快速排序-逆序数组", QuickSortV3Fragment.class));

        list.add(new BaseBean("希尔排序"));
        list.add(new BaseBean("排序-希尔排序", ShellInsertionSortV1Fragment.class));
        list.add(new BaseBean("排序-希尔排序-顺序数组", ShellInsertionSortV2Fragment.class));
        list.add(new BaseBean("排序-希尔排序-逆序数组", ShellInsertionSortV3Fragment.class));

        list.add(new BaseBean("插入排序"));
        list.add(new BaseBean("排序-插入排序", InsertionSortV1Fragment.class));
        list.add(new BaseBean("排序-插入排序-最坏情况", InsertionSortV2Fragment.class));
        list.add(new BaseBean("排序-插入排序-最好情况", InsertionSortV3Fragment.class));

        list.add(new BaseBean("选择排序"));
        list.add(new BaseBean("排序-选择", SelectSortV1Fragment.class));
        list.add(new BaseBean("排序-选择-最好情况", SelectSortV2Fragment.class));
        list.add(new BaseBean("排序-选择-最坏情况", SelectSortV3Fragment.class));

        list.add(new BaseBean("冒泡排序"));
        list.add(new BaseBean("排序-冒泡(柱形图)V1", BubbleSortColumnChartV1Fragment.class));
        list.add(new BaseBean("排序-冒泡(柱形图)V2", BubbleSortColumnChartV2Fragment.class));
        list.add(new BaseBean("排序-冒泡(柱形图)最好情况", BubbleSortColumnChartV3Fragment.class));
        list.add(new BaseBean("排序-冒泡(柱形图)最差情况", BubbleSortColumnChartV4Fragment.class));
    }

    @Override
    protected void clickItem(BaseBean bean) {
        if (bean == null) {
            return;
        }
        Intent intent = new Intent(this, AlgorithmMainActivity.class);
        intent.putExtra("code", bean.getCode());
        intent.putExtra("targetClass", bean.getTargetClass());
        startActivity(intent);
    }
}